import "@/styles/element-dark.scss";
import "@/styles/element.scss";
import "@/styles/common.scss";
import "element-plus/dist/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import "@/assets/iconfont/iconfont.scss";
import "@/assets/iconfont/iconfont.js";
import "@/assets/fonts/font.scss";
import "@/assets/css/context-menu.css";
import "@/assets/css/edit.css";
import "aieditor/dist/style.css";
import { createApp } from "vue";
import App from "./App.vue";
import router from "@/routers";
import pinia from "@/stores";
import i18n from "@/languages";
import elementPlus from "element-plus";
import { globalExceptionHandler } from "@/config";
import * as Icons from "@element-plus/icons-vue";
import { batchUseComponents } from "@/components";
import directives from "@/directives";

const app = createApp(App);
app.config.errorHandler = globalExceptionHandler;
Object.keys(Icons).forEach((key) => {
  app.component(key, Icons[key as keyof typeof Icons]);
});
batchUseComponents(app);
app.use(router);
app.use(pinia);
app.use(i18n);
app.use(directives);
app.use(elementPlus);
app.mount("#app");
